version: '3.8'
services:
  db:
    image: postgres:13
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: aviasales
      POSTGRES_USER: roflandown
      POSTGRES_PASSWORD: 1234
    volumes:
      - ./tables:/docker-entrypoint-initdb.d:ro

  app:
    build: .
    ports:
      - "8080:8080"
    depends_on:
      - db
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/aviasales
      SPRING_DATASOURCE_USERNAME: roflandown
      SPRING_DATASOURCE_PASSWORD: 1234
